import { baseURL } from '!/app.json'
import { request } from "./request";


/**
 * [signMonth 睡眠报告打点
 * @Author   ZQ
 * @param device_sn
 */
export const signMonth: any = (params: any) => {
    return request.get(`${baseURL}weixin/SleepBelt/signMonth`, { params });
};


/**
 * [getSleepBeltDetailes 睡眠报告详情
 * @Author   ZQ
 * @param device_sn
 */
export const getSleepBeltDetailes: any = (params: any) => {
    return request.get(`${baseURL}weixin/SleepBelt/index`, { params });
};


/**
 * [setSleepBodyMovement 设置一键呼体动预警
 * @Author   ZQ
 * @param device_sn
 */
export const setSleepBodyMovement: any = (data: any) => {
    return request.post(`${baseURL}Weixin/SleepBelt/setSleepBodyMovement`, { data });
};

/**
 * [getSleepBeltDetailes 获取睡眠报告
 * @Author   ZQ
 * @param device_sn
 */
export const getSleepBodyMovement: any = (params: any) => {
    return request.get(`${baseURL}Weixin/SleepBelt/getSleepBodyMovement`, { params });
};

/**
 * [getAlarmList 设备报警日志
 * @param  device_sn
 */
export const getAlarmList: any = (data) => {
    return request.post(`${baseURL}Weixin/Alarm/alarmList`, { data });
};

/**
 * [getFingeSettings  查询血氧-手指夹用户参数
 * @param  device_sn
 */
export const getFingeSettings: any = (params) => {
    return request.get(`${baseURL}weixin/SleepBelt/getFingerClip`, { params });
};

/**
 * [setFingerClip  设置血氧-手指夹用户参数
 * @param  device_sn
 * @param  enable
 * @param start_time_h
 * @param start_time_m
 * @param end_time_h
 * @param end_time_m
 * @param intervals
 * @param time_out
 * @param sex
 * @param height
 * @param weight
 * @param age     
 */
export const setFingerClip: any = (params) => {
    return request.get(`${baseURL}weixin/SleepBelt/setFingerClip`, { params });
};


/**
 * [getFingerClipList 获取血氧报告
 * @param  device_sn
 * @param  s_time
 * @param  e_time
 * @param  page
 */
export const getFingerClipList: any = (params) => {
    return request.get(`${baseURL}weixin/SleepBelt/fingerClipList`, { params });
};

/**
 * [fingerClipDetail 获取血氧报告详情
 * @param  device_sn
 * @param session_id
 * @param start_time
 * @param report_vari  周报--weekly 月报--monthly
 */
export const fingerClipDetail: any = (device_sn, session_id = '', start_time = '',) => {
    return request.get(`${baseURL}weixin/SleepBelt/fingerClipDetail?device_sn=${device_sn}&session_id=${session_id}&start_time=${start_time}`);
};

/**
 * [fingerClipDetailWeekAndMonth 获取血氧报告详情--周报月报
 * @param  device_sn
 * @param start_time
 * @param report_vari  周报--weekly 月报--monthly
 */
export const fingerClipDetailWeekAndMonth: any = (device_sn, start_time = '', report_vari = 'weekly') => {
    return request.get(`${baseURL}weixin/SleepBelt/fingerClipDetail?device_sn=${device_sn}&start_time=${start_time}&report_vari=${report_vari}`);
};


/**
 * [getStepData 查询步数数据
 * @param  deviceId
 * @param type
 * @param startTime
 * @param endTime
 * @param device_sn
 * @param pupillus_mobile
 */
export const getStepData: any = (data) => {
    return request.post(`${baseURL}Weixin/steps/select`, { data });
};

/**
 * [setGoalApi 设置目标步数
 * @param  number
 * @param deviceId
 * @param device_sn
 */
export const setGoalApi: any = (data) => {
    return request.post(`${baseURL}Weixin/steps/setGoal`, { data });
};
/**
 * [getHeartRateToday 获取今日心率数据
 * @param  deviceId
 * @param device_sn
 * @param pupillus_mobile
 */
export const getHeartRateToday: any = (data) => {
    return request.post(`${baseURL}Weixin/HeartRate/today`, { data });
};

/**
 * [getHeartRateHistory 获取本周心率数据
 * @param  deviceId
 * @param device_sn
 * @param pupillus_mobile
 */
export const getHeartRateHistory: any = (data) => {
    return request.post(`${baseURL}Weixin/HeartRate/history`, { data });
};

/**
 * [getBloodPressureData 获取今日血压数据
 * @param  type
 * @param device_sn
 * @param pupillus_mobile
 * @param day_date
 */
export const getBloodPressureData: any = (data) => {
    return request.post(`${baseURL}Weixin/UserData/getBloodPressureData`, { data });
};

/**
 * [getBloodPressureData 7日心率数据对比
 * @param  deviceId
 * @param point
 * @param device_sn
 */
export const sameMoment: any = (data) => {
    return request.post(`${baseURL}Weixin/HeartRate/sameMoment`, { data });
};

/**
 * [historyHeart 历史心率数据
 * @param  deviceId
 * @param type 1
 * @param device_sn
 */
export const historyHeart: any = (data) => {
    return request.post(`${baseURL}Weixin/HeartRate/history`, { data });
};



